package edu.xkd.slice;

import edu.xkd.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.DirectionalLayout;
import ohos.agp.components.Image;

public class MainAbilitySlice extends AbilitySlice {
    Image image_01=null;
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
        DirectionalLayout layout_01=(DirectionalLayout)this.findComponentById(ResourceTable.Id_layout_01);
        image_01=(Image)this.findComponentById(ResourceTable.Id_image_01);
        layout_01.setDoubleClickedListener(this::DoubleClickedListener);
    }

    private void DoubleClickedListener(Component component) {
        image_01.setImageAndDecodeBounds(ResourceTable.Media_red);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
